{{! Client-side Handlebars template for rendering subscriptions. }}
<div class="stream-row" data-stream-id="{{stream_id}}" data-stream-name="{{name}}">

    {{#if subscribed}}
        <div class="check checked sub_unsub_button">

            <div class="tippy-zulip-tooltip" data-tooltip-template-id="unsubscribe-from-{{stream_id}}-stream-tooltip-template">
                <template id="unsubscribe-from-{{stream_id}}-stream-tooltip-template">
                    <span>
                        {{#tr}}
                            Unsubscribe from <z-stream></z-stream>
                            {{#*inline "z-stream"}}{{> ../inline_decorated_channel_name stream=this}}{{/inline}}
                        {{/tr}}
                    </span>
                </template>

                <i class="zulip-icon zulip-icon-subscriber-check sub-unsub-icon"></i>
            </div>
            <div class='sub_unsub_status'></div>
        </div>
    {{else}}
        <div class="check sub_unsub_button {{#unless should_display_subscription_button}}disabled{{/unless}}">

            <div class="tippy-zulip-tooltip"  data-tooltip-template-id="{{#if should_display_subscription_button}}subscribe-to-{{stream_id}}-stream-tooltip-template{{else}}cannot-subscribe-to-{{stream_id}}-stream-tooltip-template{{/if}}">
                <template id="subscribe-to-{{stream_id}}-stream-tooltip-template">
                    <span>
                        {{#tr}}
                            Subscribe to <z-stream></z-stream>
                            {{#*inline "z-stream"}}{{> ../inline_decorated_channel_name stream=this}}{{/inline}}
                        {{/tr}}
                    </span>
                </template>

                <template id="cannot-subscribe-to-{{stream_id}}-stream-tooltip-template">
                    <span>
                        {{#tr}}
                            Cannot subscribe to <z-stream></z-stream>
                            {{#*inline "z-stream"}}{{> ../inline_decorated_channel_name stream=this}}{{/inline}}
                        {{/tr}}
                    </span>
                </template>

                <i class="zulip-icon zulip-icon-subscriber-plus sub-unsub-icon"></i>
            </div>
            <div class='sub_unsub_status'></div>
        </div>
    {{/if}}
    {{> subscription_setting_icon . }}
    <div class="sub-info-box">
        <div class="top-bar">
            <div class="stream-name">{{name}}</div>
            <div class="subscriber-count tippy-zulip-tooltip" data-tippy-content="{{t 'Subscriber count' }}">
                {{> subscriber_count .}}
            </div>
        </div>
        <div class="bottom-bar">
            <div class="description rendered_markdown" data-no-description="{{t 'No description.'}}">{{rendered_markdown rendered_description}}</div>
            {{#if is_old_stream}}
            <div class="stream-message-count tippy-zulip-tooltip" data-tippy-content="{{t 'Estimated messages per week' }}">
                <i class="fa fa-bar-chart"></i>
                <span class="stream-message-count-text">{{stream_weekly_traffic}}</span>
            </div>
            {{else}}
            <div class="stream-message-count tippy-zulip-tooltip" data-tippy-content="{{t 'Channel created recently' }}">
                <span class="stream-message-count-text">{{t "New" }}</span>
            </div>
            {{/if}}
        </div>
    </div>
</div>
